package com.threeti.mecool.core.domain.model.basicdata.biz;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * 通路，即终端
 */
@Embeddable
public class Channel implements Serializable {
	@Column(name = "CHANNEL_CODE")
	private String code;

	@Column(name = "CHANNEL_NAME")
	private String name;

	@Column(name = "CHANNEL_ADDRESS")
	private String address;

	@Column(name = "CHANNEL_CAT_CODE")
	private String category;

	@Column(name = "CHANNEL_SYS_CAT")
	private String sysCategory;

	@Column(name = "CHANNEL_ADMIN_DIV_ID")
	private Long adminDivId;

	// jay:redundant gift for reporting->
	@Column(name = "CHANNEL_PROVINCE_AD_NAME")
	private String provinceAdName;

	@Column(name = "CHANNEL_PROVINCE_AD_CODE")
	private String provinceAdCode;

	@Column(name = "CHANNEL_CITY_AD_NAME")
	private String cityAdName;

	@Column(name = "CHANNEL_CITY_AD_CODE")
	private String cityAdCode;

	@Column(name = "CHANNEL_AD_NAME")
	private String adName;

	@Column(name = "CHANNEL_AD_CODE")
	private String adCode;
	// <-

	public Channel(String code, String name, String address, String category,String sysCategory, Long adminDivId) {
		super();
		this.code = code;
		this.name = name;
		this.address = address;
		this.category = category;
		this.sysCategory = sysCategory;
		this.adminDivId = adminDivId;
	}

	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}

	/** 通路类别 */
	public String getCategory() {
		return category;
	}

	/** 通路系统类别 */
	public String getSysCategory() {
		return sysCategory;
	}

	public Long getAdminDivId() {
		return adminDivId;
	}

	public String getAddress() {
		return address;
	}

	public String getProvinceAdName() {
		return provinceAdName;
	}

	public String getProvinceAdCode() {
		return provinceAdCode;
	}

	public String getCityAdName() {
		return cityAdName;
	}

	public String getCityAdCode() {
		return cityAdCode;
	}

	public String getAdName() {
		return adName;
	}

	public String getAdCode() {
		return adCode;
	}

	public void setAdName(String adName) {
		this.adName = adName;
	}

	public void setAdCode(String adCode) {
		this.adCode = adCode;
	}

	public void setAdminDivId(Long adminDivId) {
		this.adminDivId = adminDivId;
	}

	public void setCityAdName(String cityAdName) {
		this.cityAdName = cityAdName;
	}

	public void setCityAdCode(String cityAdCode) {
		this.cityAdCode = cityAdCode;
	}

	public void setProvinceAdName(String provinceAdName) {
		this.provinceAdName = provinceAdName;
	}

	public void setProvinceAdCode(String provinceAdCode) {
		this.provinceAdCode = provinceAdCode;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	public String toString() {
		return "Channel [code=" + code + ", name=" + name + ", address="
				+ address + ", category=" + category + ", sysCategory="
				+ sysCategory + ", adminDivId=" + adminDivId + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Channel other = (Channel) obj;
		if (code == null) {
			if (other.code != null)
				return false;
		} else if (!code.equals(other.code))
			return false;
		return true;
	}

	Channel() {
		super();
	}
	
	
}
